<cfquery name="queryDoubleForSelectedUser" datasource="tidtool">
	SELECT 
		N.*
	FROM 
		Named N
	INNER JOIN 
		NamedDouble_Person NDP
		ON NDP.NamedID = N.ID
	WHERE
		NDP.PersonID = #userID#
	ORDER BY
		N.MonsterName
</cfquery>
<cfoutput>
	<div class="windowDiv">
		<table>
			<cfif queryDoubleForSelectedUser.recordCount eq 0>
				<tr>
					<th colspan="3">
						Entweder noch nix eingetragen, oder der Char hat schon alle Named.
					</th>
				</tr>
			</cfif>
			<tr>
				<th>Named</th>
				<th>Wird gebraucht von</th>
			</tr>
			<cfloop query="queryDoubleForSelectedUser">
				<tr>
					<cfquery name="queryPossibleReceiver" datasource="tidtool">
						SELECT P.*
						FROM
							Person P
						INNER JOIN
							Named_Person NP
							ON NP.PersonID = P.ID
						WHERE
							NP.NamedID = #queryDoubleForSelectedUser.ID#
					</cfquery>
					<td>
						#queryDoubleForSelectedUser.MonsterName#
					</td>
					<td>
						<cfloop query="queryPossibleReceiver">
							#Username#
						</cfloop>&nbsp;
					</td>
				</tr>
			</cfloop>
		</table>
	</div>
</cfoutput>